//||=========================================================================||
//||                                                                         ||
//||                          SimpleCudaCounter.cpp                          ||
//||                                                                         ||
//||                           by the_best_goose))                           ||
//||                                                                         ||
//||=========================================================================||

#include "SimpleCudaCounter.h"
#include "MandelbrotCounter.cu.h"

//-----------------------------------------------------------------------------

SimpleCudaCounter::SimpleCudaCounter(const MainWindow* pwind,
                                     const QWidget* pmand_pic):
    SimpleMandelbrotCounter(pwind, pmand_pic)
{
}

//-----------------------------------------------------------------------------

SimpleCudaCounter::~SimpleCudaCounter()
{
}

//-----------------------------------------------------------------------------

void SimpleCudaCounter::run()
{
    CountMandelbrot((int*)pixels_, px_size_.width(), px_size_.height(),
                   graph_rect_.left(), graph_rect_.right(),
                    graph_rect_.bottom(), graph_rect_.top(), iters_);
    for(int i = 0; i < px_size_.width() * px_size_.height(); ++i)
        pixels_[i] = index_array_[pixels_[i]];

    emit Counted();

}
